package cn.yunyichina.provider.base.service.impl;

import cn.yunyichina.provider.base.entity.Rule;
import cn.yunyichina.provider.base.entity.RuleAttribute;
import cn.yunyichina.provider.base.utils.CacheConstant;
import cn.yunyichina.provider.framework.dubbo.service.CacheService;
import cn.yunyichina.provider.iface.entity.common.Response;
import cn.yunyichina.utils.convert.JsonUtils;
import com.alibaba.dubbo.common.utils.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.yunyichina.provider.base.dao.RuleAttributeDao;

import java.util.List;
import java.util.Map;

/**
 * 
 * @projectName:yyt-provider-base
 * @author:yangfan
 * @description:规则库操作
 * @date:2016年11月14日
 * @className:RuleattributeServiceImpl
 * @pakeage:cn.yunyichina.provider.base.service.impl
 */
@Service
public class RuleattributeServiceImpl {
	private static final Logger logger = LoggerFactory.getLogger(RuleattributeServiceImpl.class);
	@Autowired
	private RuleAttributeDao ruleAttributeDao;


	/**
	 *
	 * @methodName:selectRule yyt.base.ruleattribute.list
	 * @description:获取规则属性
	 * @param data
	 * @return:Response
	 */
	public Response listRuleattribute(String data) {
		Response response = new Response();
		RuleAttribute ruleAttribute = JsonUtils.parseObject(data, RuleAttribute.class);

		List<RuleAttribute> list = ruleAttributeDao.select(ruleAttribute);
		response.setResult(JsonUtils.toJsonString(list));
		response.setResultCodeAndMessage("0","查询成功");
		return response;
	}
}
